$("#pay").click(function () {
    var channelId = $('input[name=requestUrl]:checked').val();
    if (channelId == undefined || channelId == '') {
        $("#errortip").text("请选择一种支付方式");
    }
    else {
        $("#errortip").text();
        var applyId = $("#applyId").val();
        var url = "/Cashie/PayChannel?applyId=" + applyId + "&channelId=" + channelId;
        openwin(url);
    }
    var GyPayId = $('input[name=GyQuike]:checked').val();
    if (GyPayId == undefined || GyPayId == '') {
        $("#errortip").text("请选择一种支付方式");
    } else {
        var phone = $('input[name=GyQuike]:checked').parent().find('input[id=cartPhone]').eq(0).val();
        $('#PaytelText').text(phone);
        $('.bind_box').show();
        $('#gy_zf').show().siblings('.pay_box').hide();
    }
});

function openwin(url) {
    var a = document.createElement("a");
    a.setAttribute("href", url);
    a.setAttribute("target", "_blank");
    a.setAttribute("id", "openwin");
    document.body.appendChild(a);
    a.click();
}
$(".btn a").click(function () {
    $(this).addClass('gn_payfor_active').siblings('a').removeClass('gn_payfor_active');
    var eq = $(this).index();
    $('.gn_payfor_choose').eq(eq).css('display', 'block').siblings('.gn_payfor_choose').css('display', 'none');
    $("input[type='radio']").attr("checked", false);
});
$(function () {
    $("input[type='radio']").click(function () {
        $("#errortip").text("");
        $('.gn_payfor_icon').removeClass("active");
        if ($(this).parent().find(".gn_payfor_icon")) {
            $(this).parent().find(".gn_payfor_icon").addClass("active");
        }
    })
});
$('.bank_list ul li').click(function () {
    selectThePlatform(this);
    $(this).addClass('cur').siblings().removeClass('cur');
});
function selectThePlatform(Obj) {
    var $radio = $(Obj).find("input[type=radio]");
    if (!$radio.is(":checked")) {
        $radio.prop("checked", true);
    }
}